import 'package:boss/color_constant.dart';
import 'package:boss/models/store_type.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/widget/shadow_radius_card.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class StoreTypeItem extends StatelessWidget {
  final StoreType data;
  final bool isSelected;
  final VoidCallback onTap;

  const StoreTypeItem({
    Key key,
    @required this.data,
    this.isSelected = false,
    this.onTap,
  }) : super(key: key);

  TextStyle get textStyle => isSelected
      ? TextStyleConstant().white_28
      : TextStyleConstant().normal_1_28;

  Color get bgColor => isSelected ? ColorConstant.ff5770f6 : Colors.white;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      behavior: HitTestBehavior.translucent,
      child: Container(
        decoration: BoxDecoration(
          color: bgColor,
          boxShadow: [
            DEFAULT_SHADOW,
          ],
          borderRadius: BorderRadius.circular(
            14.w,
          ),
        ),
        alignment: Alignment.center,
        child: Text(
          data.storeTypeName,
          style: textStyle,
        ),
      ),
    );
  }
}
